import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/mategroup',
    method: 'GET',
    params: query
  })
}

export function fetchMategroup(query) {
  return request({
    url: `/mategroup/GetAllMateGroupByTenant/${query}`,
    method: 'GET'
  })
}

export function saveMategroup(data) {
  return request({
    url: '/mategroup',
    method: 'POST',
    data
  })
}

export function deleteMategroup(id) {
  return request({
    url: `/mategroup/${id}`,
    method: 'DELETE'
  })
}

export function updateMategroup(data) {
  return request({
    url: `/mategroup/${data.Id}`,
    method: 'PUT',
    data
  })
}

export function getMategroup(id) {
  return request({
    url: `/mategroup/${id}`,
    method: 'GET'
  })
}
